package myapps.ttclient.protocol.message;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import myapps.ttclient.GlobalVariables;
import myapps.ttclient.Helper;
import myapps.ttclient.baseclass_and_interface.TTClientMessage;


public class AdminAuthentificationRequestMessage extends TTClientMessage
{
	//public String password;
	
//	public AuthentificationRequestMessage(String password)
//	{
//		this.password = password;
//	}
	
	public byte[] encrypedPassword;
	
	public AdminAuthentificationRequestMessage(byte[] encrypedPassword)
	{
		this.encrypedPassword = encrypedPassword;
	}
	
	
	public static TTClientMessage parse(DataInputStream dis) throws IOException
	{
		throw new IOException("NotImplemented");
	}
	
	@Override
	public void toDataOutputStream(DataOutputStream dos) throws IOException
	{
		dos.writeByte(ADMIN_AUTHENTIFICATION_REQUEST);
		dos.writeInt(GlobalVariables.NO_LENGTH_CODE);

		//Helper.WriteStringToDataOutputStream(dos, this.password);
		
		Helper.WriteByteArrayToDataOutputStream(dos, this.encrypedPassword);
	}
}
